<!--
	作者：956911785@qq.com
	时间：2019年10月11日16:40:29
	描述：书籍信息统计
-->
<template>
    <div style="width:100%;"> 
		<Fytable ref="tdtable" height="550" :columns="columns9" type="post" :paramiters="searchparams" :serverUrl="serverUrl" @changeSort='changeSort'></Fytable>
		<readstatic ref="readstatic" :readid="readid"></readstatic>
		<noreadstatic ref="noreadstatic" :readid="readid"></noreadstatic>
	</div> 
</template>
<script>
	import readstatic from "./readstatic/manage";
	import noreadstatic from "./noreadstatic/manage";
    export default {
    	name: "poetrystaticss",
    	props: {
    		tj:{
    			type: Object
    		},	
    	},
        data () {
            return {
				readid:'',
				searchparams:{
					pname:'',//书籍名称
					author:'',//作者
					nj:'',//推荐年级
					bj:'',//推荐班级
					order:'ALLNUM desc',//排序情况
				},
            	serverUrl:"/host/readbook/staticlog/poetryread_static.html",
                columns9: [ 
					{
					    type: 'index',
					    width: 60,
					    title: '序号',
					    align: 'center'
					},{
					    title: '诗词名称',
					    key: 'PNAME',
					    align: 'center',
					},{
					    title: '作者',
					    key: 'AUTHOR',
					    align: 'center', 
					},{
					    title: '任务年级',
					    key: 'NJ',
					    align: 'center', 
						sortable: true
					}, {
					    title: '任务班级',
					    key: 'BJ',
					    align: 'center', 
						sortable: true
					}, {
					    title: '发布时间',
					    key: 'PUBILSHTIME',
					    align: 'center', 
						sortable: true
					}, {
					    title: '背诵总人数',
					    key: 'ALLNUM',
					    align: 'center', 
						sortable: true,
						render: (h, params) => {
							return h("a", { 
						    	on: { 
						    		click: () => {
										this.readid=params.row.READID;
						    			this.$refs.readstatic.modal0=true;
						    		}	
						    	} 
							},params.row.ALLNUM)
						}
					}, {
					    title: '未背诵总人数',
					    key: 'NOREAD',
					    align: 'center', 
						sortable: true,
						render: (h, params) => {
							return h("a", { 
						    	on: { 
						    		click: () => {
										this.readid=params.row.READID;
						    			this.$refs.noreadstatic.modal0=true;
						    		}	
						    	} 
							},params.row.NOREAD)
						}
					}
                ],
				
            }
        },
        computed: {
		},
		methods: {
			load(){
				this.$refs.tdtable.load();
			},
			
			changeSort(column){
				this.searchparams.order=column.key+" "+column.order;
			}

	    },
		mounted() {
			this.$refs.tdtable.load();
		},
		watch:{
			tj: {
				deep: true,
				handler: function() {
					this.searchparams={
						pname:this.tj.pname,//书籍名称
						author:this.tj.author,//作者
						nj:this.tj.nj,//推荐年级
						bj:this.tj.bj,//推荐班级
						order:'ALLNUM desc',//排序情况
					}
				},	
			}
			
		},
		components: {
			readstatic,
			noreadstatic
		}
    }
</script>


<style scoped="scoped">
	
	.ivu-table-wrapper {
		border:none;
	}
	
	.toolstipdiv{
		width: '100%';
		overflow: 'hidden';
		textOverflow: 'ellipsis';
		whiteSpace: 'normal';
		wordBreak: 'break-all';
		color:'#fff';
		text-align: center;
	}
	.toolstipdiv:hover{
		background:rgb(63, 193, 201);
	}
	
	.ivu-tooltip-rel label:hover{
		color:#0023FB;
	}
	
	.tablediv{
		height: '40px';
		overflow:'hidden';
		line-height: '40px';
	}
</style>



